<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- v-if是真正意义上的删除或者重新渲染，而v-show只是display属性的变化 -->

<body>
    <script src="./js/vue.js"></script>
    <div class="box">
        <div v-if="show">牛砚耕是蔡徐坤</div>
        <div v-else>牛砚耕和蔡徐坤是好哥俩</div>
        <div v-show="show">蔡徐坤是牛砚耕</div>
        <button @click="show=!show">切换</button>

        <p>请嫁给我吧！</p>
        <p v-if='flag1'>我考虑考虑</p>
        <p v-else-if="flag1">勉强答应吧</p>
        <p v-else>有房有车有五百万吗！！</p>
        <p v-show="flag">{{mag}}</p>
    </div>
    <script>
        const vm_ifshow = new Vue({
            el: '.box',
            data: {
                show: false,
                flag: true,
                flag1: false,
                msg: '逗你玩！！'
            }
        })
    </script>
</body>

</html>